package com.zkjl.protect_business.repository;

import com.zkjl.protect_business.entity.Business;
import com.zkjl.protect_business.vo.BusinessVO;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface BusinessRepository extends ElasticsearchRepository<Business, String> {

    List<Business> findAllByPid(String pid);

    Business findByName(String name);

    List<Business> findAllByName(String name);

    List<Business> findAllByNameAndPid(String name, String pid);

    List<Business> findAllByIdInOrderByCreateTimeAsc(List<String> ids);

    List<Business> findAllByPidOrderByCreateTimeAsc(String pid);

    List<Business> findAllByPidAndSortBetween(String pid, Integer sort, Integer sort2);

}
